#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style>
    button {
        background: #758ef0;
        color: #FFF;
        border: none;
        border-radius: 15px;
    }
</style>
#end


#define content()
<div class="layui-fluid">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px; color: #009688">
        <legend style="font-size: 20px;font-weight: 500;">审查团体</legend>
    </fieldset>

    <form id="person" class="layui-form" action="">
        <div class="layui-form-pane">

            <div class="layui-form-item">
                <label class="layui-form-label" for="organization" style="width: 180px">组织机构名称</label>
                <div class="layui-input-block" style="margin: 0 180px">
                    <input type="text" id="organization" name="organization" placeholder="#(organization)"value="#(organization)"
                           class="layui-input " style="width: 500px" disabled/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label" for="reviewGroup.name" style="width: 180px">审查团体名称</label>
                <div class="layui-input-block" style="margin: 0 180px">
                    <input type="text" id="reviewGroup.name" name="reviewGroup.name" value="#(organization)"
                           class="layui-input " style="width: 500px" required/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label" for="reviewGroup.scope"style="width: 180px">服务范围</label>
                <div class="layui-input-block" style="margin: 0 180px">
                    <input type="text" id="reviewGroup.scope" name="reviewGroup.scope"
                           value="#(reviewGroup.scope)" class="layui-input" style="width: 500px" required/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label" for="reviewGroup.performance"style="width: 180px">服务业绩</label>
                <div class="layui-input-block" style="margin: 0 180px">
                    <input type="text" id="reviewGroup.performance" name="reviewGroup.performance"
                           value="#(reviewGroup.performance)" class="layui-input"style="width: 500px" required/>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label" for="reviewGroup.resume" style="width: 680px;">
                    <h style="margin: 0 50px">人员简历</h>
                </label>
                <div class="layui-input-block">
					<textarea id="reviewGroup.resume" name="reviewGroup.resume" placeholder="" class="layui-textarea"
                              cols="100" rows="2" wrap="hard" autocomplete="off" style="width: 680px">#(reviewGroup.resume)</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" for="reviewGroup.content"style="width: 180px">专业内容</label>
                <div class="layui-input-block" style="margin: 0 180px">
                    <input type="text" id="reviewGroup.content" name="reviewGroup.content"
                           value="#(reviewGroup.content)" class="layui-input" style="width: 500px" required/>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label" for="reviewGroup.administrator"style="width: 180px">管理员姓名</label>
                <div class="layui-input-block" style="margin: 0 180px">
                    <input type="text" id="reviewGroup.administrator" name="reviewGroup.administrator"
                           value="#(reviewGroup.administrator)" class="layui-input" style="width: 500px" required/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label" for="reviewGroup.contact"style="width: 180px">管理员联系方式</label>
                <div class="layui-input-block" style="margin: 0 180px">
                    <input type="tel" id="reviewGroup.contact" name="reviewGroup.contact"
                           value="#(reviewGroup.contact)" class="layui-input" style="width: 500px" lay-verify="required|phone"/>
                </div>
            </div>

            <div class="layui-form-item layui-hide">
                <label class="layui-form-label" for="source"style="width: 180px">部门资源</label>
                <div class="layui-input-block" style="margin: 0 180px">
                    <input type="text" id="source" name="source"
                           value="#(source)" class="layui-input" style="width: 500px" required/>
                </div>
            </div>

            <!--隐藏flag作为界面是否禁用的方法-->
            <input type="text" id="flag" name="flag"
                   class="layui-input layui-disabled layui-hide" value="#(flag)" required/>
            <input type="text" id="notiId" name="notiId"
                   class="layui-input layui-disabled layui-hide" value="#(notiId)" required/>

            <br>
            <div class="layui-form-item">
                <div class="layui-input-block" style="margin: 0 180px">
                    <button type="button" class="layui-btn" lay-submit lay-filter="pass" id="pass">通过</button>
                    <button type="button" class="layui-btn layui-btn-warm" lay-submit lay-filter="fail" id="fail">不通过</button>
                    <button type="button" class="layui-btn layui-btn-warm" id="back">返回</button>
                </div>
            </div>
        </div>
    </form>
</div>

#end


#define js()
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        var layer = layui.layer
            , $ = layui.jquery
            , form = layui.form;

        form.on('submit(pass)', function (data) {
            util.sendAjax({
                type: 'POST',
                url: '#(ctxPath)'+$("#source").val()+'Review?verify=2',
                data: $.param(data.field),
                loadFlag: true,
                success: function (data) {
                    history.go(-1);
                },
                error: function (data) {
                    console.log(data);
                }
            });
            return false;
        });

        form.on('submit(fail)', function (data) {
            util.sendAjax({
                type: 'POST',
                url: '#(ctxPath)'+$("#source").val()+'Review?verify=1',
                data: $.param(data.field),
                loadFlag: true,
                success: function (data) {
                    history.go(-1);
                },
                error: function (data) {
                    console.log(data);
                }
            });
            return false;
        });
    });

    if ($('#flag').val() == 2) {
        $("#pass").addClass("layui-disabled");
        $("#pass").attr("disabled", "disabled");
    }else if($('#flag').val() == 1){
        $("#fail").addClass("layui-disabled");
        $("#fail").attr("disabled", "disabled");
    }

    $('#back').click(function () {
        history.back();
    });
    $('#reset').click(function () {
        history.back();
    });
</script>
#end